package websocket

import (
	"im/im-cloud/app/controller/websocket"
	"im/im-cloud/app/data"
	ser "im/server/websocket"
)

// Dispatchers todo 存储控制的方法的map
var Dispatchers map[string]func(*ser.Server, *data.Receive)

func init() {
	// 将要执行的控制器方法加入 Dispatchers
	Dispatchers = map[string]func(*ser.Server, *data.Receive){
		"register": websocket.Register,
	}

	ser.OnOpen = OnOpen
	ser.OnMessage = OnMessage
	ser.OnClose = OnClose

	ser.HeartbeatCheckInterval = 10

	ser.NewServer("", "/ws")
}
